# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=kcolorpicker
pkgver=0.2.0
pkgrel=0
pkgdesc="Qt based Color Picker with popup menu"
url="https://github.com/ksnip/kColorPicker"
arch="all"
license="LGPL-3.0-or-later"
depends_dev="qt5-qtbase-dev"
makedepends="$depends_dev
	cmake
	samurai
	"
checkdepends="xvfb-run"
subpackages="$pkgname-dev"
source="https://github.com/ksnip/kColorPicker/archive/v$pkgver/kcolorpicker-$pkgver.tar.gz"
builddir="$srcdir/kColorPicker-$pkgver"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=TRUE \
		-DBUILD_TESTS=ON \
		-DBUILD_EXAMPLE=OFF
	cmake --build build
}

check() {
	cd build
	CTEST_OUTPUT_ON_FAILURE=TRUE xvfb-run -a ctest
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
44f9f317ebe5dd3131a9e44071f9f5b397b0d5cceece566f3ecf19932c8e36dafe1a434e623239421bead9413f0859bc3380174d7f14843770691e4d15a956eb  kcolorpicker-0.2.0.tar.gz
"
